package com.lancoo.znbkxx.teacher.adapter

import android.graphics.Color
import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.lancoo.znbkxx.teacher.R
import com.lancoo.znbkxx.teacher.model.data.ImportKlg
import kotlinx.android.synthetic.main.item_zsd_detail.view.*


/**
 * Created by wealive on 2021/3/12.
 *
 *
 */
class ZsdListShowAdapter(data: MutableList<ImportKlg>) :
        BaseQuickAdapter<ImportKlg, BaseViewHolder>(data) {
    init {
        mLayoutResId = R.layout.item_zsd_detail
    }

    override fun convert(helper: BaseViewHolder, item: ImportKlg?) {
        with(helper.itemView) {
            tv_zsd.text = item?.Name
            tv_zsd.setTextColor(Color.parseColor(if (item?.IsSelect == 1) "#ffffff" else "#00afff"))
            tv_zsd.setBackgroundResource(
                    if (item?.IsSelect == 0) R.drawable.aibk_bg_zsd else R.drawable.aibk_bg_zsd_select)
        }
    }
}